package com.joeyzh.table;

import android.text.TextUtils;

import com.joey.ui.CheckedModel;

/**
 * created by znx on 2019/1/17 14:28
 *
 * @author znx
 *         modified by Joey 完善明细的
 */
public class SpinnerItem extends CheckedModel {

    private String ItemName;
    private String ItemCode;

    public SpinnerItem(String id, String name) {
        super(id, name);
        setItemName(name);
        setItemCode(id);
    }

    public SpinnerItem(String itemName) {
        super(itemName, itemName);
        setItemName(itemName);
    }

    public String getItemName() {
        return ItemName;
    }

    public void setItemName(String itemName) {
        ItemName = itemName;
    }

    @Override
    public String getId() {
        if (TextUtils.isEmpty(getItemCode())) {
            return ItemName;
        }
        return ItemCode;
    }

    @Override
    public String getName() {
        return ItemName;
    }

    public String getItemCode() {
        return ItemCode;
    }

    public void setItemCode(String itemCode) {
        ItemCode = itemCode;
    }
}
